package com.android.tea.config;

import java.io.File;

import android.os.Environment;

/**
 * 缓存的相关配置
 */
public class CacheConfig {
	
	//图片缓存清理时间,24小时制,每天上午10点启动任务;
	public static final int IMAGE_CACHE_CLEAR_TIME=10;
	public static final int LINK_CACHE_COUNT=25;
	
	private static final String ROOT_DIR = Environment.getExternalStorageDirectory() + "/tea/";
	private static final String IMG_DIR = CacheConfig.ROOT_DIR + "img/";
	private static final String SAVE_IMG_DIR = CacheConfig.ROOT_DIR + "save_img/";

	public static String getSaveImageDir() {
		File file = new File(SAVE_IMG_DIR);
		if (!file.exists()) {
			file.mkdirs();
		}
		return file.getAbsolutePath()+"/";
	}
	
	public static String getRootDir() {
		File file = new File(ROOT_DIR);
		if (!file.exists()) {
			file.mkdirs();
		}
		return file.getAbsolutePath()+"/";
	}

	public static String getImgDir() {
		File file = new File(IMG_DIR);
		if (!file.exists()) {
			file.mkdirs();
		}
		return file.getAbsolutePath()+"/";
	}
}
